<template>
  <div class="search-house">
    <div class="house-block" v-for="(item, index) in searchHouseList" :key="index">
      <div class="house-box">
        <div class="left"><img :src="item.house" alt="" /></div>
        <div class="right">
          <p class="top">{{ item.title }}</p>
          <p class="center">{{ item.huxing }} -{{ item.area }}m²</p>
          <p class="bottom">
            <span class="bottom-left"> {{ item.cztype }} </span>
            <span class="bottom-right"> {{ item.price }} </span>
          </p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "SearchHouse",
  props: {
    searchHouseList: {
      type: Array,
      default: [],
    },
  },
};
</script>

<style lang="less">
.house-block {
  margin-top: 0.2rem;
}
.house-box {
  width: 90%;
  height: 2.5rem;
  margin: 0 auto;
  border-radius: 0.1rem;
  box-shadow: 0px 0px 0.2rem #ccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .left {
    width: 2.5rem;
    height: 2rem;
    margin-left: 0.2rem;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .right {
    width: 3.6rem;
    height: 2rem;
    margin-right: 0.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    color: rgba(000, 000, 000, 0.8);
    p {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .top {
      font-size: 16px;
      font-weight: 600;
    }
    .center {
      font-size: 13px;
      margin: 0.2rem 0;
    }
    .bottom {
      font-size: 13px;
      display: flex;
      justify-content: space-between;
      .bottom-left {
        color: rgb(77, 148, 120);
        border: 1px solid #ccc;
        padding: 0.05rem 0.2rem;
        border-radius: 0.1rem;
      }
      .bottom-right {
        font-size: 16px;
        font-weight: 600;
        color: #ff5555;
      }
    }
  }
}
</style>
